import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:${USER}
 * Date:${YEAR}-${MONTH}-${DAY}
 * ${TIME}
 */
public class Main {
    public static void main(String[] args) {
        int a1=Integer.MIN_VALUE;
        long a=Integer.MIN_VALUE-1;//溢出
        long a2=(long)Integer.MIN_VALUE-1;//表示先转为long在进行减法
        long a3=(long)(Integer.MIN_VALUE-1);//这是进行减法后的值转化为long
        System.out.println(a1+" " +a);
        System.out.println(a2+" "+a3);
    }
}
class Solution {
    public List<List<Integer>> fourSum(int[] nums, int target) {
        Arrays.sort(nums);//排序

        List<List<Integer>> ret=new ArrayList<>();

        int n=nums.length;
        for(int i=0;i<n;){//固定第一个数字
            int a1=nums[i];

            for(int j=i+1;j<n;){//固定第二个数字//下面相当于三数之和
                int a2=nums[j];
                int left=j+1,right=n-1;
                long target1=(long)target-a1-a2;//如果target存储的是最小值，再减法的话会溢出
                while(left<right){
                    int num=nums[left]+nums[right];
                    if(num>target1)right--;
                    else if(num<target1)left++;
                    else{
                        ret.add(new ArrayList(Arrays.asList(nums[i],nums[j],nums[left],nums[right])));
                        left++;
                        right--;
                        while(left<right&&nums[left]==nums[left-1])left++;
                        while(left<right&&nums[right]==nums[right+1])right--;
                    }
                }
                j++;
                while(j<n&&nums[j]==nums[j-1])j++;
            }
            i++;
            while(i<n&&nums[i]==nums[i-1])i++;
        }
        return ret;
    }
}